<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>JSON</title>
	</head>
	<body>
		<h1>JSON对象创建</h1>
		<script>
			person={    //花括号表示对象,对象拥有属性
				name:"Jack",
				age:20,
				addr:{  //对象嵌套
					homeAddr:'北京海淀区',
					workAddr:'太原小店区'
				}
				
			};  
			students=[      //数组
				{
					name:'wyn',age:'20'
				},
				{name:'lxy',age:'28'}
			];
			s={			    //嵌套
    			"sites": [
    			{ "name":"菜鸟教程" , "url":"www.runoob.com" }, 
    			{ "name":"google" , "url":"www.google.com" }, 
    			{ "name":"微博" , "url":"www.weibo.com" }
    					]

			}
		
			//alert(person["age"]);
			alert(person.addr.homeAddr);  //链式
			alert(students[1].age);
		</script>
	</body>
</html>
